package top.superflow.version.db

import java.util.concurrent.atomic.AtomicReference

trait FieldPropertyVersion extends Version{
  
  val name : AtomicReference[String] = new AtomicReference[String]()
  
  val value : AtomicReference[Object] = new AtomicReference[Object]()
  
  def getPublicName() : String
}

object FieldPropertyVersion {
  val FIELD_COLUMN_NAME = "name"
  val FIELD_TYPE = "fieldType"
  val FIELD_INSERTABLE = "insertable"
  val FIELD_LENGTH = "length"
  val FIELD_NULLABLE = "nullable"
  val FIELD_PRECISION = "precision"
  val FIELD_SCALE = "scale"
  val FIELD_UNIQUE = "unique"
  val FIELD_UPDATABLE = "updatable"
  
  val JPA_FIELD_COLUMN_NAME = "name"
  val JPA_FIELD_TYPE = "fieldType"
  val JPA_FIELD_INSERTABLE = "insertable"
  val JPA_FIELD_LENGTH = "length"
  val JPA_FIELD_NULLABLE = "nullable"
  val JPA_FIELD_PRECISION = "precision"
  val JPA_FIELD_SCALE = "scale"
  val JPA_FIELD_UNIQUE = "unique"
  val JPA_FIELD_UPDATABLE = "updatable"
  
  val DB_FIELD_COLUMN_NAME = "_name"
  val DB_FIELD_TYPE = "_fieldType"
  val DB_FIELD_LENGTH = "_length"
  val DB_FIELD_NULLABLE = "_nullable"
  val DB_FIELD_SCALE = "_scale"
  val DB_FIELD_PRECISION = "_precision"
  
  val DB_FIELD_INSERTABLE = "_insertable"  
  val DB_FIELD_UNIQUE = "_unique"
  val DB_FIELD_UPDATABLE = "_updatable"
}

